<?php
session_start();
require_once "includes/config.php";
$wId = $_GET['id'];
$userType = $_SESSION['user_type_sess'];

	  
  if(!empty($wId)) {
  
    $sqlSelLstEdit="SELECT * FROM tbl_wishlist where wishlist_id=".$wId;
    $rstSelLstEdit=mysql_query($sqlSelLstEdit);
	if(mysql_num_rows($rstSelLstEdit)>0) {
	
			$rowSelLstEdit=mysql_fetch_array($rstSelLstEdit);		    
			
			?>			
			<form name="frmEditWishList" id="frmEditWishList" method="post" action="" enctype="multipart/form-data">
			<input type="hidden" name="editWishListKey" id="editWishListKey" />
			<input type="hidden" name="hidUserType" id="hidUserType" value="<?php echo $userType; ?>">
			<input type="hidden" name="hidWishlistType" id="hidWishlistType" value="<?php echo $rowSelLstEdit['wishlist_type']; ?>">
			
			  <table width="100%" border="0">
				<tr>
				  <td width="2%">&nbsp;</td>
				  <td colspan="2">&nbsp;</td>
				</tr>
				<?php
				
				if($rowSelLstEdit["wishlist_type"]=='2') {
				
						?>
						<tr>
						  <td>&nbsp;</td>
						  <td width="21%">Enter Product name</td>
						  <td width="77%"><label>
							<input type="text" name="productName" class="inputbg" id="productName" size="33" value="<?php if(!empty($rowSelLstEdit['product_name']))
							echo $rowSelLstEdit['product_name'];
							?>"/>
						  </label></td>
						</tr>
						<tr>
						  <td>&nbsp;</td>
						  <td>Enter wish Price</td>
						  <td><input type="text" name="wishprice" id="wishprice" class="inputbg" size="33" value="<?php if(!empty($rowSelLstEdit['price']))
							echo $rowSelLstEdit['price'];
							?>"/></td>
						</tr>
						<tr>
						  <td>&nbsp;</td>
						  <td valign="top">Enter Description</td>
						  <td><label>
							<textarea name="productDescription" class="inputbg" id="productDescription" cols="25" rows="5"><?php if(!empty($rowSelLstEdit['description']))
							echo $rowSelLstEdit['description'];
							?></textarea>
						  </label></td>
						</tr>
						<tr>
						  <td>&nbsp;</td>
						  <td valign="top">Product Image</td>
						  <td><label>
							<input name="productImage" id="productImage"  type="file">
						  </label><?php if(!empty($rowSelLstEdit['product_image']))
							echo "<a href='".$rowSelLstEdit['product_image']."'> View </a>";
							?></td>
						</tr>
				<?php 
				
				} else { ?>
						
						<tr>
						  <td>&nbsp;</td>
						  <td>Enter wish Price</td>
						  <td><input type="text" name="wishprice" class="inputbg" id="wishprice" size="33" value="<?php if(!empty($rowSelLstEdit['price']))
							echo $rowSelLstEdit['price'];
							?>"/></td>
						</tr>
						
				<?php
				}
				
				?>
				<tr>
				  <td height="28">&nbsp;</td>
				  <td>&nbsp;</td>
				  <td><label>
					<input type="button" name="editWishList" id="editWishList" class="sbmt_btn" value="Edit wishlist" onclick="editWishlist('<?php echo $wId; ?>')" />
				  </label></td>
				</tr>
			  </table>
			  </form>
  
    <?php 			
	
		}
	
	} 
	
	?>